package com.chentianyu.demo01.mapper;

import com.chentianyu.demo01.obj.Students;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface StudentsMapper {

    @Select("select * from students")
    List<Students> selectAllStudents();

    @Insert("insert into students(uid,name,age) values(#{uid},#{name},#{age})")
    void postStudent(Integer uid,String name,Integer age);

    @Update("update students set sex=#{sex} where uid=#{uid}")
    void setSex_uid(Integer uid,String sex);
}
